import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/Login'
import Registry from "../views/Registry"
import ForgetPass from "../views/ForgetPass";
import Home from "../views/Home";
import BrandShow from "../components/home/brandShow";
import GoodsShow from "../components/home/goodsShow";
import InformationShow from "../components/home/informationShow";
import WarehouseShow from "../components/home/warehouseShow";
import Admin from "../views/Admin";
import AdminGoods from "../components/admin/adminGoods";
import AdminWarehouse from "../components/admin/adminWarehouse";
import DealsShow from "../components/admin/dealsShow";
import AdminInfoShow from "../components/admin/adminInfoShow";
import UserInformation from "../components/admin/userInformation";
import WalletShow from "../components/admin/walletShow";
import orderShow from "../components/home/orderShow";
import Index from "../views/index";
import Cvo from "../components/cvo/cvo";
import Information from "../components/cvo/information";
import Shop from "../components/cvo/shop";
import Message from "../components/cvo/message";
import Order from "../components/cvo/order";
import Dvo from "../components/dvo/dvo";
import Mall from "../views/Mall";
import goodsInfo1 from "../views/goodsInfo1";
import goodsInfo from "../views/goodsInfo";
import buy from "../views/Buy";
import trolley from "../views/Trolley";
Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/',
      name:'Index',
      component:Index,
      meta:{
        title:'首页'
      }
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta:{
        title:'登录'
      }
    },
    {
      path: '/registry',
      name: 'Registry',
      component:Registry,
      meta:{
        title:'注册'
      }
    },
    {
      path:'/forgetPass',
      name:'ForgetPass',
      component:ForgetPass,
      meta:{
        title:'找回密码'
      }
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      meta:{
        title:'供货商工作台'
      },
      children:[
        { path: '/informationShow',
          name: '个人信息',
          component: InformationShow
        },
        { path: '/brandShow',
          name: '品牌信息',
          component: BrandShow
        },
        { path: '/goodsShow',
          name: '商品管理',
          component: GoodsShow
        },
        { path: '/warehouseShow',
          name: '仓库管理',
          component: WarehouseShow
        },
        {
          path:'/orderShow',
          name:'订单管理',
          component: orderShow
        }
      ]
    },
    {
      path:'/admin',
      name:'admin',
      component:Admin,
      meta:{
        title:'管理员工作台'
      },
      children:[
        { path: '/adminInformation',
          name: '信息概况',
          component: AdminInfoShow
        },
        { path: '/userInformation',
          name: '用户管理',
          component: UserInformation
        },
        { path: '/adminWarehouse',
          name: '仓库管理',
          component: AdminWarehouse
        },
        { path: '/adminGoods',
          name: '商品管理',
          component: AdminGoods
        },
        {
          path: '/dealsShow',
          name: '订单管理',
          component: DealsShow
        },
        {
          path: '/walletShow',
          name: '钱包管理',
          component: WalletShow
        }
      ]
    },
    {
      path:'/cvo',
      name:'Cvo',
      component:Cvo,
      meta:{
        title:'借卖方工作台'
      },
      children:[
        {
          path: '/cvo/information',
          name:'用户信息',
          component: Information
        },
        {
          path: '/cvo/message',
          name:'消息中心',
          component: Message
        },
        {
          path: '/cvo/order',
          name:'订单管理',
          component: Order
        },
        {
          path:'/cvo/shop',
          name: '店铺管理',
          component: Shop
        }
      ]
    },
    {
      path:'/dvo',
      name:'Dvo',
      component:Dvo
    },
    {
      path:'/mall',
      name:'Mall',
      component:Mall,
      meta:{
        title:'商城首页'
      }
    },
    {
      path:'/goodsInfo',
      name:'GoodsInfo',
      component:goodsInfo,
      meta:{
        title:'商品详情'
      }
    },
    {
      path:'/goodsInfo1',
      name:'GoodsInfo1',
      component:goodsInfo1
    },
    {
      path:'/buy',
      name:'Buy',
      component:buy,
      meta:{
        title:'下单'
      }
    },
    {
      path:'/trolley',
      name:'Trolley',
      component:trolley,
      meta:{
        title:'我的购物车'
      }
    }
  ]
})
